
#ifndef GOMOKU_BOARD_HPP__
# define GOMOKU_BOARD_HPP__

# include "Gomoku.hpp"

namespace Gomoku
{
  class Board
  {
  public:
    Board(unsigned int size = 19);
    virtual ~Board();

    unsigned int getSize();
    Color::Type getCase(unsigned int x, unsigned int y);
    void setCase(unsigned int x, unsigned int y, Color::Type color);
    bool isPlayable(unsigned int x, unsigned int y);

    Color::Type getWinner();

  private:
    bool _isWinningLine(unsigned int x, unsigned int y);
    bool _checkHorizontal(unsigned int x, unsigned int y);
    bool _checkVertical(unsigned int x, unsigned int y);
    bool _checkDiagonal(unsigned int x, unsigned int y);

  private:
    unsigned int _size;
    Color::Type** _board;
  };
}

#endif // GOMOKU_BOARD_HPP__
